1. Field of the Invention
The present invention relates to cross-correlation checking for a computer mouse, and more particularly, to a cross-correlation method for a computer mouse which can selectively adjust a scale size for performing a cross-correlation check.
2. Description of the Prior Art
A mouse is one of the most popular and commonly used input devices for a computer. A standard mouse comprises a wheel or an optical sensor, which is used to determine motion of the wheel/sensor relative to a 2-D surface, and then transform the motion into motion of a cursor or arrow on a display screen of the computer.
In order to detect the movement of an optical mouse, the optical sensor captures a first frame at a first time as a reference image, and captures a second frame at a second time as a comparison image, wherein the difference between the first time and the second time is equivalent to a frame rate period of the mouse. Cross-correlation is then performed between the reference image and the comparison image in order to determine the motion of the mouse during the time period between the two captured frames.
Please refer to FIG. 1, which illustrates an example of a reference frame and a comparison frame captured by a mouse moving at a particular velocity. In FIG. 1, the reference frame is illustrated by a 10×10 block filled in with diagonal lines sloping to the right, and the comparison frame is illustrated by a 10×10 block filled in with diagonal lines sloping to the left. As illustrated in the diagram, there is a certain offset between the two images, which is illustrated by the overlapped area having a crosshatch pattern. This overlapped area can be used to determine the distance the mouse has moved during the time period between the two captured frames. Cross-correlation can be performed for the entire two frames in order to determine the exact size and location of the overlapped area, but this is time-consuming, particularly when the mouse is moving at high speeds, as the size of the offset/overlapped area becomes smaller at higher speeds. Therefore, a limited amount of cross-correlation is performed between the two frames.
The mouse sensor navigation system thereby uses a location predicted to have the peak correlation as a predicted location which indicates where the cross-correlation should be centered. The predicted location corresponds to the accumulated delta of the mouse from frame to frame and is illustrated by the black dot in FIG. 1. The correlation process can be represented by the following equation:XC(r,c)wherein XC represents cross-correlation, and (r,c) represents the reference frame and comparison frame at their respective predicted locations.
If the predicted location is incorrect, the cross-correlation performed at the wrong predicted location will lead to an incorrect motion of the mouse will be reported. This incorrect reported motion will then be used as a basis for a next predicted location, meaning the next predicted location will also be incorrect. This may result in what is known as a runaway mouse situation, where the mouse is actually stationary but the cursor on the display screen continues to move.
To correct for the above-mentioned problem, conventional methods perform a cross-correlation check at the origin, i.e. location (0,0). A scale is applied to the cross-correlation, wherein the scale will have a constant value.
When the following condition is met:XC(0,0)*Scale>XC(r,c)it is determined that a runaway situation has occurred.
When the runaway situation occurs, the navigation process of the mouse needs to be reset. This involves clearing the predicted location and any unreported motion as well as re-capturing of a new reference image. A navigation reset therefore needs to take place before tracking can occur once more.
In some situations, however, the mouse may be moving in accordance with the cursor on the display screen, but the system will still falsely report a runaway situation. This is usually due to the scale being set too high for the cross-correlation check, which results in unnecessary clearing of both predicted location and any unreported motion. This false reporting will require resetting of the navigation process, which might produce a noticeable frozen cursor and can be annoying to a user. In extreme cases, resetting of the navigation process due to a false runaway situation might actually result in the mouse being unable to track. If, however, the scale for the cross-correlation check is set too low then it is difficult to detect a real runaway situation.